from feed import feed

class feedstore:
	def __init__(self):
		pass

	def load_feeds(self):
		"""load the list of feeds - currently return a list of tuples
		of the form (feedname, url)."""
	
		self.feedlist = []
		for feed in self.feedfile.readlines():
			feedname = feed.split(' ', 1)[0]
			feedurl = feed.split(' ', 1)[1]
			self.feedlist.append((feedname, feedurl))

	def open(self, filename):
		self.feedfile = file(filename, 'r')
		self.load_feeds()

	def feeds(self):
		for (feedname, feedurl) in self.feedlist:
			yield feed(feedname, feedurl)
